home *** CD-ROM | disk | FTP | other *** search
/ Directorty Opus 5 - Magellan 2 / Opus 5 - Magellan 2.iso / Extras / opussdk / include / dopus / layout.h < prev    next >
C/C++ Source or Header  |  1996-09-05  |  17KB  |  467 lines

  1. #ifndef _DOPUS_LAYOUT
  2. #define _DOPUS_LAYOUT
  3.  
  4. /*****************************************************************************
  5.  
  6.  Layout routines
  7.  
  8.  *****************************************************************************/
  9.  
  10. #ifndef LIBRARIES_GADTOOLS_H
  11. #include <libraries/gadtools.h>
  12. #endif
  13.  
  14. #define POS_CENTER        -1        // Center position
  15. #define POS_RIGHT_JUSTIFY    -2        // Right-justified
  16.  
  17. #define POS_MOUSE_CENTER    -3        // Center over mouse
  18. #define POS_MOUSE_REL        -4        // Relative to mouse
  19.  
  20. #define POS_PROPORTION        1024        // Proportion of space left
  21. #define POS_SQUARE        1124
  22. #define POS_REL_RIGHT        (1<<14)        // Relative to another
  23.  
  24. #define FPOS_TEXT_OFFSET    16384
  25.  
  26. #define SIZE_MAXIMUM        -1
  27. #define SIZE_MAX_LESS        -101
  28.  
  29. // Defines a window
  30. typedef struct {
  31.     struct IBox cw_CharDims;
  32.     struct IBox cw_FineDims;
  33. } ConfigWindow;
  34.  
  35. // Opens a window
  36. typedef struct {
  37.     void            *nw_Parent;        // Parent to open on
  38.     ConfigWindow        *nw_Dims;        // Window dimensions
  39.     char            *nw_Title;        // Window title
  40.     struct DOpusLocale    *nw_Locale;        // Locale to use
  41.     struct MsgPort        *nw_Port;        // Message port to use
  42.     ULONG            nw_Flags;        // Flags
  43.     struct TextFont        *nw_Font;        // Alternative font to use
  44. } NewConfigWindow;
  45.  
  46. // Set by the user
  47. #define WINDOW_SCREEN_PARENT    (1<<0)        // Parent is a screen
  48. #define WINDOW_NO_CLOSE        (1<<1)        // No close gadget
  49. #define WINDOW_NO_BORDER    (1<<2)        // No border
  50. #define WINDOW_LAYOUT_ADJUST    (1<<3)        // Adjust window size to fit objects
  51. #define WINDOW_SIMPLE        (1<<4)        // Simple refresh
  52. #define WINDOW_AUTO_REFRESH    (1<<5)        // Refresh window automatically
  53. #define WINDOW_AUTO_KEYS    (1<<6)        // Handle keys automatically
  54. #define WINDOW_OBJECT_PARENT    (1<<7)        // Parent is an existing object
  55. #define WINDOW_REQ_FILL        (1<<8)        // Backfill as a requester
  56. #define WINDOW_NO_ACTIVATE    (1<<9)        // Don't activate
  57. #define WINDOW_VISITOR        (1<<10)        // Open as visitor window
  58. #define WINDOW_SIZE_RIGHT    (1<<11)        // Size gadget, in right border
  59. #define WINDOW_SIZE_BOTTOM    (1<<12)        // Size gadget, in bottom border
  60. #define WINDOW_ICONIFY        (1<<13)        // Iconify gadget
  61.  
  62. // Set by the system
  63. #define OPEN_USED_DEFAULT    (1<<16)        // To open had to use default font
  64. #define OPEN_USED_TOPAZ        (1<<17)        // To open had to use topaz
  65. #define OPEN_SHRUNK_VERT    (1<<18)        // Window is not full vertical size requested
  66. #define OPEN_SHRUNK_HORIZ    (1<<19)        // Window is not full horizontal size requested
  67. #define OPEN_SHRUNK        (OPEN_SHRUNK_VERT|OPEN_SHRUNK_HORIZ)
  68.  
  69.  
  70. // ID of the iconify gadget
  71. #define GAD_ID_ICONIFY        0xffa0
  72.  
  73. // Defines an object
  74. typedef struct {
  75.     BYTE        od_Type;
  76.     UBYTE        od_ObjectKind;
  77.     struct IBox    od_CharDims;
  78.     struct IBox    od_FineDims;
  79.     ULONG        od_GadgetText;
  80.     ULONG        od_Flags;
  81.     USHORT        od_ID;
  82.     struct TagItem *od_TagList;
  83. } ObjectDef;
  84.  
  85. #define TEXTFLAG_TEXT_STRING        (1<<17)        // Text is a string, not a Locale ID
  86. #define TEXTFLAG_NO_USCORE        (1<<18)        // No underscore in text
  87. #define BUTTONFLAG_OKAY_BUTTON        (1<<18)        // Button is an "ok" button
  88. #define BUTTONFLAG_CANCEL_BUTTON    (1<<19)        // Button is a "cancel" button
  89. #define BUTTONFLAG_TOGGLE_SELECT    (1<<20)        // Button is toggle-select
  90. #define LISTVIEWFLAG_CURSOR_KEYS    (1<<21)        // Lister responds to cursor
  91. #define BUTTONFLAG_THIN_BORDERS        (1<<22)        // Button has thin borders
  92. #define FILEBUTFLAG_SAVE        (1<<21)        // Save mode
  93.  
  94. #define TEXTFLAG_ADJUST_TEXT        (1<<23)        // Adjust for text
  95. #define POSFLAG_ADJUST_POS_X        (1<<24)        // Position adjustor
  96. #define POSFLAG_ADJUST_POS_Y        (1<<25)        // Position adjustor
  97. #define POSFLAG_ALIGN_POS_X        (1<<26)        // Align
  98. #define POSFLAG_ALIGN_POS_Y        (1<<27)        // Align
  99.  
  100. #define TEXTFLAG_RIGHT_JUSTIFY        (1<<1)        // Right-justify text
  101. #define TEXTFLAG_CENTER            (1<<2)        // Center text
  102.  
  103. #define AREAFLAG_RAISED            (1<<8)        // Raised rectangle
  104. #define AREAFLAG_RECESSED        (1<<9)        // Recessed rectangle
  105. #define AREAFLAG_THIN            (1<<10)        // Thin borders
  106. #define AREAFLAG_ICON            (1<<11)        // Icon drop box
  107. #define AREAFLAG_ERASE            (1<<12)        // Erase interior
  108. #define AREAFLAG_LINE            (1<<13)        // Line (separator)
  109. #define AREAFLAG_OPTIM            (1<<15)        // Optimised refreshing
  110. #define AREAFLAG_TITLE            (1<<16)        // Box with a title
  111. #define AREAFLAG_NOFILL            (1<<18)        // No fill
  112.  
  113. #define OBJECTFLAG_DRAWN        (1<<31)        // Object has been drawn
  114.  
  115. #define OD_END        0        // End of a list
  116. #define OD_GADGET    1        // A gadget
  117. #define OD_TEXT        2        // Some text
  118. #define OD_AREA        3        // A rectangular area
  119. #define OD_IMAGE    4        // An image
  120. #define OD_SKIP        -1        // Skip this entry
  121.  
  122. typedef struct _GL_Object
  123. {
  124.     struct _GL_Object    *next;        // Next object
  125.     short            type;        // Type of object
  126.     char            key;        // Key equivalent
  127.  
  128.     unsigned char        flags2;        // Additional flags
  129.  
  130.     unsigned short        id;        // Object ID
  131.     unsigned short        control_id;    // Object that this controls
  132.     struct IBox        dims;        // Object dimensions
  133.     ULONG            flags;        // Object flags
  134.     char            *text;        // Text
  135.     USHORT            object_kind;    // Object kind
  136.  
  137.     union
  138.     {
  139.         struct _gl_gadget
  140.         {
  141.             struct Gadget *context;    // Context data for the gadget
  142.             struct Gadget *gadget;    // The gadget itself
  143.             int components;        // Number of component gadgets
  144.             LONG data;        // Some data for the gadget
  145.             short choice_max;    // Number of choices
  146.             short choice_min;    // Minimum choice
  147.             struct Image *image;    // Gadget image
  148.         } gl_gadget;
  149.  
  150.         struct _gl_text
  151.         {
  152.             struct IBox text_pos;    // Text position
  153.             WORD base_pos;        // Baseline position
  154.             short uscore_pos;    // Underscore position
  155.         } gl_text;
  156.  
  157.         struct _gl_area
  158.         {
  159.             struct IBox text_pos;    // Text position within area
  160.             struct IBox area_pos;    // Area position
  161.             int frametype;        // Frame type
  162.         } gl_area;
  163.  
  164.         struct _gl_image
  165.         {
  166.             struct IBox image_pos;    // Image position
  167.             struct Image *image;    // Image
  168.         } gl_image;
  169.     } gl_info;
  170.  
  171.     APTR memory;                // Any other memory
  172.  
  173.     char *original_text;            // Original text string
  174.     char fg,bg;                // Current pen colours
  175.  
  176.     ULONG    data_ptr;            // Pointer to other data
  177.  
  178.     struct TagItem    *tags;            // Copy of tags
  179.  
  180.     struct IBox char_dims;            // Original dimensions
  181.     struct IBox fine_dims;
  182. } GL_Object;
  183.  
  184. typedef struct _ObjectList {
  185.     GL_Object        *firstobject;    // First object
  186.     struct TextAttr        attr;        // Font used
  187.     struct Window        *window;    // Window used
  188.     struct _ObjectList    *next_list;    // Next list
  189. } ObjectList;
  190.  
  191. #define OBJECTF_NO_SELECT_NEXT    (1<<0)        // Don't select next field
  192. #define OBJECTF_PATH_FILTER    (1<<1)        // Filter path characters
  193. #define OBJECTF_SECURE        (1<<2)        // Hide string
  194. #define OBJECTF_INTEGER        (1<<3)        // Integer gadget
  195. #define OBJECTF_READ_ONLY    (1<<4)        // Read-only
  196. #define OBJECTF_HOTKEY        (1<<5)        // Hotkey string
  197.  
  198. typedef struct {
  199.     UBYTE    md_Type;            // Menu type
  200.     ULONG    md_ID;                // Menu ID
  201.     ULONG    md_Name;            // Menu name
  202.     ULONG    md_Flags;            // Menu flags
  203. } MenuData;
  204.  
  205. #define MENUFLAG_TEXT_STRING    (1<<16)        // Menu name is a real string
  206. #define MENUFLAG_COMM_SEQ    (1<<17)        // Give menu a command sequence
  207. #define MENUFLAG_AUTO_MUTEX    (1<<18)        // Automatic mutual exclusion
  208. #define MENUFLAG_USE_SEQ    (1<<19)        // Use command sequence supplied
  209.  
  210. #define MENUFLAG_MAKE_SEQ(c)    ((ULONG)(c)<<24)
  211. #define MENUFLAG_GET_SEQ(fl)    ((char)((fl)>>24))
  212.  
  213. #define NM_NEXT            10
  214. #define NM_BAR_LABEL    (ULONG)NM_BARLABEL
  215.  
  216. #define IS_GADTOOLS(obj)        (BOOL)(obj->gl_info.gl_gadget.context)
  217.  
  218. typedef struct
  219. {
  220.     ULONG            magic;        // Magic ID
  221.     struct Window        *window;    // Pointer back to window
  222.     ULONG            window_id;    // User window ID
  223.     struct MsgPort        *app_port;    // "Window's" application port
  224. } WindowID;
  225.  
  226. #define WINDOW_MAGIC        0x83224948
  227. #define WINDOW_UNKNOWN        (ULONG)-1
  228. #define WINDOW_UNDEFINED    0
  229.  
  230. #define SET_WINDOW_ID(w,id)    (((WindowID *)((w)->UserData))->window_id=(id))
  231.  
  232. // Window types
  233. #define WINDOW_BACKDROP            0x4000001
  234. #define WINDOW_LISTER            0x4000002
  235. #define WINDOW_BUTTONS            0x4000004
  236. #define WINDOW_GROUP            0x4000008
  237. #define WINDOW_LISTER_ICONS        0x4000010
  238. #define WINDOW_FUNCTION            0x4000020    // not really a window
  239. #define WINDOW_START            0x4000040
  240.  
  241. #define WINDOW_POPUP_MENU        0x0001200
  242. #define WINDOW_TEXT_VIEWER        0x0001300
  243.  
  244. #define WINDOW_USER            0x2000000
  245.  
  246. // This structure is pointed to by Window->UserData
  247. typedef struct
  248. {
  249.     WindowID        id;        // Window ID information
  250.  
  251.     ObjectList        *list;        // Window object list
  252.     struct FileRequester    *request;    // Window's file requester
  253.     APTR            visinfo;    // Visual info
  254.     struct DrawInfo        *drawinfo;    // Draw info
  255.     struct DOpusLocale    *locale;    // Locale info
  256.     struct MsgPort        *window_port;    // Window message port (if supplied)
  257.     struct NewMenu        *new_menu;    // NewMenu structure allocated
  258.     struct Menu        *menu_strip;    // Menu strip allocated
  259.     struct Requester    *busy_req;    // Window busy requester
  260.     ULONG            data;        // Window-specific data
  261.     ULONG            flags;        // Flags
  262.     APTR            memory;        // User memory pool, freed when window closes
  263.  
  264.     APTR            hook_magic;    // Magic for backfill hooks
  265.     struct FontRequester    *font_request;    // Window's font requester
  266.  
  267.     ULONG            userdata;
  268.     struct TagItem        *user_tags;
  269.  
  270.     struct List        boopsi_list;    // BOOPSI list
  271. } WindowData;
  272.  
  273. #define FILE_GLASS_KIND    1000
  274. #define DIR_GLASS_KIND    1001
  275.  
  276. #define GM_RESIZE    (20)
  277.  
  278. struct gpResize
  279. {
  280.     ULONG            MethodID;
  281.     struct GadgetInfo    *gpr_GInfo;
  282.     struct RastPort        *gpr_RPort;
  283.     struct IBox        gpr_Size;
  284.     long            gpr_Redraw;
  285.     struct Window        *gpr_Window;
  286.     struct Requester    *gpr_Requester;
  287. };
  288.  
  289. // Custom tags
  290. #define GTCustom_LocaleLabels    TAG_USER + 0    // Points to list of Locale IDs
  291. #define GTCustom_Image        TAG_USER + 1    // Image for gadget
  292. #define GTCustom_CallBack    TAG_USER + 2    // Tag ID and data filled in by callback
  293. #define GTCustom_LayoutRel    TAG_USER + 3    // Layout relative to this object ID
  294. #define GTCustom_Control    TAG_USER + 4    // Controls another gadget
  295. #define GTCustom_TextAttr    TAG_USER + 6    // TextAttr to use
  296. #define GTCustom_MinMax        TAG_USER + 24    // Minimum and maximum bounds
  297. #define GTCustom_ThinBorders    TAG_USER + 27    // Gadget has thin borders
  298. #define GTCustom_LocaleKey    TAG_USER + 29    // Key from locale string
  299. #define GTCustom_NoSelectNext    TAG_USER + 31    // Don't select next field
  300. #define GTCustom_PathFilter    TAG_USER + 32    // Filter path characters
  301. #define GTCustom_History    TAG_USER + 33    // History
  302. #define GTCustom_CopyTags    TAG_USER + 34    // Copy tags
  303. #define GTCustom_FontPens    TAG_USER + 35    // Place to store pens and style
  304. #define GTCustom_FontPenCount    TAG_USER + 36    // Number of pens for font requester
  305. #define GTCustom_FontPenTable    TAG_USER + 37    // Table of pens for font requester
  306. #define GTCustom_Bold        TAG_USER + 38    // Bold pen
  307. #define GTCustom_Secure        TAG_USER + 39    // Secure string field
  308. #define GTCustom_Integer    TAG_USER + 40    // Integer gadget
  309. #define GTCustom_TextPlacement    TAG_USER + 41    // Position of text
  310. #define GTCustom_NoGhost    TAG_USER + 42    // Disable without ghosting
  311. #define GTCustom_Style        TAG_USER + 44    // Pen styles
  312. #define GTCustom_FrameFlags    TAG_USER + 45    // Frame flags
  313. #define GTCustom_ChangeSigTask    TAG_USER + 46    // Task to signal on change
  314. #define GTCustom_ChangeSigBit    TAG_USER + 47    // Signal bit to use
  315. #define GTCustom_LayoutPos    TAG_USER + 49    // Use with the POSFLAGs
  316. #define GTCustom_Borderless    TAG_USER + 50    // Borderless
  317. #define GTCustom_Justify    TAG_USER + 51    // Justification
  318.  
  319. #define LAYOUTF_SAME_HEIGHT    (1<<0)
  320. #define LAYOUTF_SAME_WIDTH    (1<<1)
  321. #define LAYOUTF_TOP_ALIGN    (1<<2)
  322. #define LAYOUTF_BOTTOM_ALIGN    (1<<3)
  323. #define LAYOUTF_LEFT_ALIGN    (1<<4)
  324. #define LAYOUTF_RIGHT_ALIGN    (1<<5)
  325.  
  326. #define JUSTIFY_LEFT        0
  327. #define JUSTIFY_RIGHT        1
  328. #define JUSTIFY_CENTER        2
  329.  
  330. #define DIA_Type        TAG_USER + 5    // Image type
  331. #define DIA_FrontPen        TAG_USER + 7    // Image front pen
  332.  
  333. #define IM_ARROW_UP    0
  334. #define IM_ARROW_DOWN    1
  335. #define IM_CHECK    2
  336. #define IM_DRAWER    3
  337. #define IM_BORDER_BOX    4
  338. #define IM_BBOX        5
  339. #define IM_ICONIFY    6
  340. #define IM_CROSS    7
  341. #define IM_LOCK        8
  342.  
  343. #define OPUS_LISTVIEW_KIND    127        // Custom listview gadget
  344. #define FILE_BUTTON_KIND    126        // File button gadget
  345. #define DIR_BUTTON_KIND        125        // Directory button gadget
  346. #define FONT_BUTTON_KIND    124        // Font button gadget
  347. #define FIELD_KIND        123        // Text field (no editing)
  348. #define FRAME_KIND        122        // Frame
  349. #define HOTKEY_KIND        121        // Hotkey field
  350.  
  351. // Listview tags
  352. #define DLV_TextAttr        TAG_USER + 6    // TextAttr to use
  353. #define DLV_ScrollUp        TAG_USER + 7        // Scroll list up
  354. #define DLV_ScrollDown        TAG_USER + 8        // Scroll list down
  355. #define DLV_SelectPrevious    TAG_USER + 11        // Select previous item
  356. #define DLV_SelectNext        TAG_USER + 12        // Select next item
  357. #define DLV_Labels        GTLV_Labels        // Labels
  358. #define DLV_Top            GTLV_Top        // Top item
  359. #define DLV_MakeVisible        GTLV_MakeVisible    // Make visible
  360. #define DLV_Selected        GTLV_Selected        // Selected
  361. #define DLV_ScrollWidth        GTLV_ScrollWidth    // Scroller width
  362. #define DLV_ShowSelected    GTLV_ShowSelected    // Show selected
  363. #define DLV_Check        TAG_USER + 10        // Check selection
  364. #define DLV_Highlight        TAG_USER + 14        // Highlight selection
  365. #define DLV_MultiSelect        TAG_USER + 9        // Multi-selection
  366. #define DLV_ReadOnly        GTLV_ReadOnly        // Read only
  367. #define DLV_Lines        TAG_USER + 13        // Visible lines (get only)
  368. #define DLV_ShowChecks        TAG_USER + 15        // Show checkmarks
  369. #define DLV_Flags        TAG_USER + 16        // Layout flags
  370. #define DLV_NoScroller        TAG_USER + 17        // No scroller necessary
  371. #define DLV_TopJustify        TAG_USER + 18        // Top-justify items
  372. #define DLV_RightJustify    TAG_USER + 19        // Right-justify items
  373. #define DLV_DragNotify        TAG_USER + 20        // Notify of drags
  374. #define DLV_GetLine        TAG_USER + 25        // Get line from coordinate
  375. #define DLV_DrawLine        TAG_USER + 26        // Draw a line from the listview
  376. #define DLV_Object        TAG_USER + 27        // Pointer to object
  377. #define DLV_DoubleClick        TAG_USER + 28        // Indicates double-click
  378. #define DLV_ShowFilenames    TAG_USER + 48        // Show filenames only
  379.  
  380. typedef struct
  381. {
  382.     struct RastPort        *rp;
  383.     struct DrawInfo        *drawinfo;
  384.     struct Node        *node;
  385.     unsigned short        line;
  386.     struct IBox        box;
  387. } ListViewDraw;
  388.  
  389. // Listview node data
  390. #define lve_Flags        ln_Type            // Listview entry flags
  391. #define lve_Pen            ln_Pri            // Listview entry pen
  392. #define LVEF_SELECTED        (1<<0)            // Entry is selected
  393. #define LVEF_USE_PEN        (1<<1)            // Use pen to render entry
  394. #define LVEF_TEMP        (1<<2)            // Temporary flag for something
  395.  
  396. // File button tags
  397. #define DFB_DefPath        TAG_USER + 19        // Default path
  398.  
  399. // Palette tags
  400. #define DPG_Pen            TAG_USER + 21        // Ordinal selected pen
  401. #define DPG_SelectPrevious    TAG_USER + 22        // Select previous pen
  402. #define DPG_SelectNext        TAG_USER + 23        // Select next pen
  403.  
  404. // Some useful macros
  405. #define GADGET(obj) (obj->gl_info.gl_gadget.gadget)
  406. #define AREA(obj) obj->gl_info.gl_area
  407. #define DATA(win) ((WindowData *)win->UserData)
  408. #define WINFLAG(win) (DATA(win)->flags)
  409. #define WINMEMORY(win) (DATA(win)->memory)
  410. #define WINREQUESTER(win) (DATA(win)->request)
  411. #define OBJLIST(win) (DATA(win)->list)
  412. #define DRAWINFO(win) (DATA(win)->drawinfo)
  413. #define VISINFO(win) (DATA(win)->visinfo)
  414. #define GADSPECIAL(list,id) (GADGET(L_GetObject(list,id))->SpecialInfo)
  415. #define GADSTRING(list,id) ((struct StringInfo *)GADSPECIAL(list,id))->Buffer
  416. #define GADNUMBER(list,id) ((struct StringInfo *)GADSPECIAL(list,id))->LongInt
  417. #define GADSEL(list,id) (GADGET(L_GetObject(list,id))->Flags&GFLG_SELECTED)
  418. #define GADGET_SPECIAL(list,id) (GADGET(GetObject(list,id))->SpecialInfo)
  419. #define GADGET_STRING(list,id) ((struct StringInfo *)GADGET_SPECIAL(list,id))->Buffer
  420. #define GADGET_NUMBER(list,id) ((struct StringInfo *)GADGET_SPECIAL(list,id))->LongInt
  421. #define GADGET_SEL(list,id) (GADGET(GetObject(list,id))->Flags&GFLG_SELECTED)
  422. #define CFGDATA(win) (((WindowData *)win->UserData)->data)
  423.  
  424. #define MENUID(menu) ((ULONG)GTMENUITEM_USERDATA(menu))
  425.  
  426. // Layout functions
  427. struct Window *OpenConfigWindow(NewConfigWindow *);
  428. void CloseConfigWindow(struct Window *);
  429.  
  430. struct IntuiMessage *GetWindowMsg(struct MsgPort *);
  431. void ReplyWindowMsg(struct IntuiMessage *);
  432.  
  433. ObjectList *AddObjectList(struct Window *,ObjectDef *);
  434. void FreeObjectList(ObjectList *);
  435. GL_Object *GetObject(ObjectList *,ULONG);
  436. void SetGadgetValue(ObjectList *,USHORT,ULONG);
  437. long GetGadgetValue(ObjectList *,USHORT);
  438. void SetGadgetChoices(ObjectList *list,ULONG id,APTR choices);
  439. BOOL CheckObjectArea(GL_Object *,long,long);
  440. void DisableObject(ObjectList *,ULONG,BOOL);
  441.  
  442. void DisplayObject(struct Window *,GL_Object *,long,long,char *);
  443. void SetWindowBusy(struct Window *);
  444. void ClearWindowBusy(struct Window *);
  445. long BoundsCheckGadget(ObjectList *,ULONG,long,long);
  446. BOOL GetObjectRect(ObjectList *,ULONG,struct Rectangle *);
  447. void SetConfigWindowLimits(struct Window *,ConfigWindow *,ConfigWindow *);
  448. void LayoutResize(struct Window *);
  449.  
  450. void AddWindowMenus(struct Window *,MenuData *);
  451. void FreeWindowMenus(struct Window *);
  452.  
  453. void StartRefreshConfigWindow(struct Window *,long);
  454. void EndRefreshConfigWindow(struct Window *);
  455.  
  456. struct Menu *BuildMenuStrip(MenuData *,struct DOpusLocale *);
  457. struct MenuItem *FindMenuItem(struct Menu *,USHORT);
  458. void SetWindowID(struct Window *,WindowID *,ULONG,struct MsgPort *);
  459. ULONG GetWindowID(struct Window *);
  460. struct MsgPort *GetWindowAppPort(struct Window *);
  461.  
  462.  
  463. #define RECTWIDTH(rect)        (1+(rect)->MaxX-(rect)->MinX)
  464. #define RECTHEIGHT(rect)    (1+(rect)->MaxY-(rect)->MinY)
  465.  
  466. #endif
  467.